package cn.example.vip.mall.goods.mapper;

import cn.example.vip.mall.goods.entity.Sku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface SkuMapper extends BaseMapper<Sku> {
	/**
	 * 库存递减
	 */
	@Update("UPDATE sku SET num = num - #{num} where id = #{id} and num >= #{num}")
	int dCount(@Param("id") String id, @Param("num") Integer num);
}
